package com.xbongbong.paas.domain.entity;


import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import com.xbongbong.paas.toolbox.wrap.Entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * paas表单子表单数据(TbPaasFormPaasSubData)实体类
 *
 * @author makejava
 * @since 2020-09-04 09:41:24
 */
@Getter
@Setter
@ToString
public class PaasFormSubDataEntity extends Entity {
    private static final long serialVersionUID = 237317957567200678L;
    /**
     * 主键
     */
    private Long id;
    /**
     * 表单id
     */
    private Long formId;
    /**
     * 对应 es 中的 _id
     * 格式为 corpid_id
     */
    private String esId;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 关联的主数据id
     */
    private Long dataId;
    /**
     * 子表单的attr值
     */
    private String attr;
    /**
     * 数据
     */
    private JSONObject data;
    /**
     * 创建时间
     */
    private Long addTime;
    /**
     * 更新时间
     */
    private Long updateTime;
    /**
     * 是否删除，0未删，1删除
     */
    private Integer del;
    /**
     * 连接字段，命名不符合java规范
     */
    private JSONObject my_join_field;

    public PaasFormSubDataEntity() {
    }

    public PaasFormSubDataEntity(Long formId, String corpid, Long dataId, String attr, JSONObject data) {
        this.formId = formId;
        this.corpid = corpid;
        this.dataId = dataId;
        this.attr = attr;
        this.data = data;
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
        this.del = 0;
    }
}